/**      
 * @file		multidimensionalArrays.cpp
 * @description		This example demonstrates dynamic multidimensional arrays.
 *			Take note of the delete[] calls to clean up the memory we
 *			request.
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
using namespace std;

typedef int* IntArrayPtr; // define a new type 

/**
 * @return zero if the application executes successfully
 */
int main() {

	// 3X4 array
	// first we allocate memory for 3 rows of arrays
	IntArrayPtr *m = new IntArrayPtr[3];

	for (int i = 0; i < 3; i++) {
		// place an array of 4 ints
		m[i] = new int[4];
	}

	for(int i = 0; i < 3; i++) {
		for(int j = 0; j < 4; j++) {
			cout << "Type an integer for int[" << i << "][" << j << "] ";
			cin >> m[i][j];
		}
	}

	cout << "Outputting the array\n";
	for(int i = 0; i < 3; i++) {
		for(int j = 0; j < 4; j++) {
			cout << m[i][j] << " ";
		}
		cout << endl;
	}

	for(int i = 0; i < 3; i++) {
		delete[] m[i];	// delete each of the column arrays
	}
	delete[] m;	// delete the array (rows)
	return 0;
}
